package com.bawei.a2010douyin;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.launcher.ARouter;
import com.bawei.a2010douyin.db.dao.DBUtils;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMOptions;
import com.tencent.live2.V2TXLivePremier;
import com.tencent.rtmp.TXLiveBase;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;

import androidx.multidex.MultiDex;

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ARouter.openDebug();
        ARouter.openLog();
        ARouter.init(this);//注意！！！init放在后面
        UMConfigure.init(this,"642a7a2dba6a5259c42db735"
                ,"umeng",UMConfigure.DEVICE_TYPE_PHONE,"");//58edcfeb310c93091c000be2 5965ee00734be40b580001a0
        // QQ设置
        PlatformConfig.setQQZone("101830139","5d63ae8858f1caab67715ccd6c18d7a5");
        // PlatformConfig.setQQFileProvider("com.tencent.sample2.fileprovider");

        EMOptions options = new EMOptions();
        options.setAppKey("1118220824134411#2010douyin");

        EMClient.getInstance().init(this, options);
        //数据库初始化
        DBUtils.getInstance().init(this);

        //腾讯云
        String licenceURL = "https://license.vod2.myqcloud.com/license/v2/1316790624_1/v_cube.license"; // 获取到的 licence url
        String licenceKey = "cd52a461f8ca1c4fc985e267ffa5db5d"; // 获取到的 licence key
        V2TXLivePremier.setLicence(this, licenceURL, licenceKey);
        V2TXLivePremier.setObserver(new V2TXLivePremier.V2TXLivePremierObserver() {
            @Override
            public void onLicenceLoaded(int result, String reason) {
                Log.i("TAG", "onLicenceLoaded: result:" + result + ", reason:" + reason);
            }
        });


    }
    //分包
    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}
